Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format number for The Netherlands #185

Merged
merged 2 commits into from
May 18, 2024

Conversation

jessetan
Copy link
Contributor

What has been done

The default formatting for phone number from the Netherlands used the format .. ......... That is, a two digit area code followed by the rest of the number.

However area codes can be either two or three digits (plus one if you count the optional 0 which should be omitted in E.164 notation).
A full list from the Dutch government is here: https://wetten.overheid.nl/jci1.3:c:BWBR0010198&bijlage=1&z=2022-12-16&g=2022-12-16
The majority of the area codes are three digits and a smaller number have two digits. Notable exceptions are mobile numbers, which always start with 6.

This PR adds formatting for all one and two digit area codes, as well as one, two and three digit area codes with the optional leading 0. If no area code matches, it is assumed to be a three digit area code without leading 0.

Checklist before requesting a review

  • I have read the contributing doc before submitting this PR.
  • Commit titles correspond to the convention.
  • I have performed a self-review of my code.
  • Tests for the changes have been added (for bug fixes/features).
  • Docs have been added / updated (for bug fixes / features).

Screenshots (if appropriate):

Copy link

vercel bot commented May 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-international-phone-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 2:25pm
react-international-phone-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 2:25pm

@goveo goveo changed the base branch from master to development May 18, 2024 14:10
@goveo goveo self-requested a review May 18, 2024 14:10
@goveo goveo changed the base branch from development to master May 18, 2024 14:11
@goveo goveo changed the base branch from master to development May 18, 2024 14:12
Copy link
Owner

@goveo goveo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!
Thanks for the contribution 🙏

@goveo
Copy link
Owner

goveo commented May 18, 2024

🎉 This PR is included in version 4.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@goveo goveo added the released label May 18, 2024
@jessetan jessetan deleted the feat/format-nl-numbers branch May 21, 2024 07:56
@ThulinaWickramasinghe
Copy link

Hi @jessetan!

I'm facing an issue with validating numbers starting from '097'. We're using your phone input to get OTPs and we have users worldwide. But due to formatting numbers like this (+31 97010290042) are not allowed. Disabling formatting doesn't help as well since still number length is validated.

It is said that these numbers are M2M numbers but there are mentions of numbers like the following which say these are being used to get SMS.

https://issuetracker.google.com/issues/74493346#comment6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants